﻿Imports Aricie.DNN.UI.Attributes
Imports Aricie.DNN.UI.WebControls
Imports Aricie.DNN.Modules.LuceneSearch.Business
Imports System.Reflection
Imports Aricie.Services
Imports System.Linq

Namespace Aricie.DNN.Modules.LuceneSearch.Settings.AutoCompleteSettings

    Public Class OutputFieldsSelector
        Inherits SelectorControl(Of PropertyInfo)

        Private Shared m_PropertiesSearchResult As Dictionary(Of String, PropertyInfo)
        Private Shared m_Properties As New List(Of PropertyInfo)

        Shared Sub New()
            m_PropertiesSearchResult = ReflectionHelper.GetPropertiesDictionary(Of LuceneSearchResultsInfo)()
            For Each e In m_PropertiesSearchResult
                m_Properties.Add(e.Value)
            Next
            m_Properties = m_Properties.OrderBy(Function(pi) pi.Name).ToList()
        End Sub


        Public Overrides Function GetEntitiesG() As IList(Of PropertyInfo)
            Return m_Properties
        End Function
    End Class
End Namespace